﻿package  {
	
	import flash.display.MovieClip;
	
	
	public class SwitchTile extends Tile {
		
		private var _player:Player
		private var _switchID:int;
		
		public function SwitchTile(aX:Number,aY:Number,aWidth:Number,aHeight:Number,switchID:int,aPlayer:Player) {
			// constructor code
			super(aX,aY,aWidth,aHeight);
			_player = aPlayer;
			_switchID = switchID;
		}
		
		override public function CollisionCheck(locX:int, locY:int):Boolean{
			//trace("" + hitTestPoint(locX,locY));
			
			if(hitTestPoint(locX,locY))
			{
				switch(_switchID)
				{
					case 0:
					_player.Switch1 = true;
					break;
					
					case 2:
					_player.Switch2 = true;
					break;
					
					case 5:
					_player.Switch3 = true;
					break;
					
					case 7:
					_player.Switch4 = true;
					break;
				}
				//trace("switch" + _switchID);
			}
			
			return false;
			
		}
	}
	
}

